<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>终点小说后台管理系统</title>
    <%
  	
    String random=Math.random()+"";
    request.setAttribute("random", random);
    %>
   
  <link rel="stylesheet" href="assets/jquery/jquery-ui.css?v=${random}">
    <link rel="stylesheet" href="assets/css/adminIndex.css?v=${random}" />

  </head>

  <body>
    <!-- 创建一个包含全部的总div -->
    <div class="adminAllDiv">

      <!-- 页面的顶栏 -->
      <header class="adminHeader">
        <!-- 侧边栏显示 -->
         <div class="adminHeaderNavShow">
          <img src="image/butoton.jpg" alt="" class="">
         </div>

        <!-- 时间显示 -->
        <span class="adminHeaderDate"></span>

        <!-- log显示 -->
        <div class="adminHeaderLogo">
            <!-- Logo图片 -->
            <p>终点uykyukuykuty管理</p>
        </div>

        <!-- 用户名显示以及退出登录页面 -->
        <span class="adminHeaderName">
            <span>管理员：${sessionScope.user.getUserNickName()}</span>
            <!-- 退出页面链接 -->&nbsp;&nbsp;&nbsp;&nbsp;
             <a href="ExitServlet" class="adminHeaderExit">退出</a>
        </span>

      </header>


      <!-- 页面侧栏 -->
      <nav class="adminNav">

        <!-- logo页面 -->
        <div class="adminNavDivShow">
          <img alt="" src="images/logo2.png">
        </div>

        <!-- 各级菜单栏 -->
        <div id="adminNavMenu" class="adminNavMenu">
            
            <h3>&nbsp;用户管理菜单</h3>
            <div>
                <p><a href="#" id="ck">用户查看</a></p>
                
                <p><a href="#" id="add">添加用户</a></p>
                <p><a href="#" id="ufind">用户查找</a></p>
            </div>
            <h3>&nbsp;小说管理菜单</h3>
            <div>
                 <p><a href="#" id="novelck">查看小说</a></p>
                  <p><a href="#" id="addNovel">添加小说</a></p>
                  <p><a href="#" id="NovelSearch">小说搜索</a></p>
                <p><a href="#" id="approvalNovel">小说审批</a></p>
            </div>
            <h3>&nbsp;小说章节管理菜单</h3>
            <div>
                 <p><a href="#" id="chapterCK">查看章节</a></p>
                  <p><a href="#" id="addChapter">添加小说章节</a></p>
                  <p><a href="#" id="ChapterSearch">章节搜索</a></p>
               	<p><a href="#" id="approvalChapter">小说章节审批</a></p>
            </div>
              <h3>&nbsp;主页轮播图管理菜单</h3>
            <div>
                 <p><a href="#" id="lb">轮播详情</a></p>
                  
               
            </div>
            
            

        <!-- 隐藏按钮 -->
         <div class="adminNavHide">
            <img src="image/butoton.jpg" alt="">
         </div>

      </nav>
      <iframe src="user.jsp" frameborder="0" id="myframe"></iframe>

      <!-- 页面底部 -->
      <footer class="adminFooter"></footer>
      <!-- 右侧详细信息 -->
      <article>
      </article>
      <button></button>
    </div>
  </body>
  <script src="assets/jquery/jquery-3.7.1.js"></script>
  <script src="assets/jquery/jquery-ui.js"></script>
  <script src="assets/js/adminIndex.js"></script>
  <script>
    //初始化函数
    $(function () {
      //调用更新界面方法
      updateInterface();
    });

    //更新总界面函数
    function updateInterface(){
      //设置Alldiv
      setAdminAllDivSize();
      //设置侧栏
      $(".adminNav").width($(".adminAllDiv").width() * 0.15);
      $(".adminNav").height($(".adminAllDiv").height());
      setAdminNavSize();
      //设置顶栏
      setAdminHeaderSize();
      //设置底栏大小
      setAdminFooterSize();
      //循环设置时间
      getDate();
      //隐藏顶栏的显示按钮
      $(".adminHeaderNavShow").hide();
    }

    //隐藏侧边栏函数
    function hideNav(){
      //设置侧边栏大小
      //侧边栏设置
      $(".adminNav").width("0px");
      $(".adminNav").height("0px");
      //设置Alldiv
      setAdminAllDivSize();
      //设置顶栏
      setAdminHeaderSize();
      //设置底栏大小
      setAdminFooterSize();
      //循环设置时间
      getDate();
      $(".adminHeaderNavShow").show();
    }

    //浏览器窗口变化调用函数
    window.addEventListener('resize', function(event){
      updateInterface();
    });

    // 使All自适应大小
    function setAdminAllDivSize() {
      $(".adminAllDiv").width($(window).width());
      $(".adminAllDiv").height($(window).height());
    }

    //设置侧栏大小
    function setAdminNavSize() {
      //侧边栏设置
      $(".adminNav").width($(".adminAllDiv").width() * 0.15);
      $(".adminNav").height($(".adminAllDiv").height());
      //管理员信息展示页面设置
      $(".adminNavDivShow").width($(".adminNav").width()*0.9);
      $(".adminNavDivShow").height($(".adminNav").height()*0.15);
      $(".adminNavDivShow").css("left",$(".adminNav").width()*0.05);
      $(".adminNavDivShow").css("top",$(".adminNav").height()*0.02);
      $(".adminNavAdminImg").width($(".adminNavDivShow").width()*0.35);
      $(".adminNavAdminImg").height($(".adminNavDivShow").width()*0.35);
      $(".adminNavAdminImg").css("left",$(".adminNavDivShow").width()*0.05);
      $(".adminNavAdminImg").css("top",$(".adminNavDivShow").width()*0.05);
      $(".adminNavAdminName").css("left",$(".adminNavDivShow").width()*0.41);
      $(".adminNavAdminName").css("top",$(".adminNavDivShow").height()*0.2);
      $(".adminNavAdminPass").css("left",$(".adminNavDivShow").width()*0.41);
      $(".adminNavAdminPass").css("top",$(".adminNavDivShow").height()*0.5);
      //各级菜单栏设置
      $(".adminNavMenu").width($(".adminNav").width()*0.9);
      $(".adminNavMenu").height($(".adminNav").height()*0.55);
      $(".adminNavMenu").css("left",$(".adminNav").width()*0.05);
      $(".adminNavMenu").css("top",$(".adminNav").height()*0.04+$(".adminNavDivShow").height());
      //隐藏按钮设置
      $(".adminNavHide").width($(".adminNav").width()*0.15);
      $(".adminNavHide").height($(".adminNav").width()*0.15);
    }
    //iframe设置
  
    //设置侧栏的显示隐藏

    //设置顶栏内容,宽度为All减去侧栏
    function setAdminHeaderSize() {
      //顶栏设置
      $(".adminHeader").width(
      $(".adminAllDiv").width() - $(".adminNav").width());
      $(".adminHeader").height($(".adminAllDiv").height() * 0.08);
      $(".adminHeader").css("left", $(".adminNav").width());
      //顶栏内Logo设置
      $(".adminHeaderLogo").width($(".adminHeader").width()*0.15);
      $(".adminHeaderLogo").height($(".adminHeader").height());
      $(".adminHeaderLogo>img").width($(".adminHeaderLogo").width());
      $(".adminHeaderLogo>img").height($(".adminHeaderLogo").height());
      //顶栏时间设置
      $(".adminHeaderDate").css("left",$(".adminHeader").width()*0.01);
      $(".adminHeaderDate").css("top",$(".adminHeader").height()*0.2);
      //顶栏退出设置
      $(".adminHeaderName").css("left",$(".adminHeader").width()*0.94);
      $(".adminHeaderName").css("top",$(".adminHeader").height()*0.2);
    }

    //设置底栏大小
    function setAdminFooterSize() {
      $(".adminFooter").width(
      $(".adminAllDiv").width() - $(".adminNav").width());
      $(".adminFooter").height($(".adminAllDiv").height() * 0.03);
      $(".adminFooter").css("left", $(".adminNav").width());
      $(".adminFooter").css("top",$(".adminAllDiv").height() - $(".adminFooter").height());
    }

    //时间获取函数
    function getDate() {
      // 获取当前时间
      var now = new Date();
      // 提取本地日期的年、月和日
      var year = now.getFullYear();
      var month = now.getMonth() + 1; // 月份是从 0 开始的，所以需要加 1
      var day = now.getDate();
      // 提取本地时间的小时、分钟和秒
      var hours = now.getHours();
      var minutes = now.getMinutes();
      var seconds = now.getSeconds();
      // 格式化时间为 HH:mm:ss
      var formattedTime =
        year +
        "-" +
        month +
        "-" +
        day +
        "-" +
        hours +
        ":" +
        minutes +
        ":" +
        seconds 
        ;
      //设置顶栏的Span时间显示
      $(".adminHeaderDate").html(formattedTime);
    }

    //多级菜单栏方法
    $( function() {
        $( "#adminNavMenu" ).accordion({
            collapsible: true
        });
    } );
    //隐藏按钮方法，仅能隐藏
    $( ".adminNavHide" ).click(function() {
      $( ".adminNav" ).hide( "slide");
      //调用隐藏侧边栏函数
      hideNav();
    });
    //显示方法，仅能显示
    $( ".adminHeaderNavShow" ).click(function() {
        $( ".adminNav" ).show("slide");
        //调用更新页面方法
        updateInterface();
    });
    
  
    $("#xx").on("click",function(){
    	console.log(11111111111);
		$("#myframe").attr("src","main.jsp");
	 });
	$("#ck").on("click",function(){
		$("#myframe").attr("src","user.jsp");
	});
	$("#add").on("click",function(){
		$("#myframe").attr("src","userAdd.jsp");
	});
	$("#ufind").on("click",function(){
		$("#myframe").attr("src","sousuoUser.jsp");
	});
	
	$("#novelck").on("click",function(){
		$("#myframe").attr("src","novel.jsp");
	});
	
	$("#addNovel").on("click",function(){
		$("#myframe").attr("src","addNnovel.jsp");
	});
	
	$("#NovelSearch").on("click",function(){
		$("#myframe").attr("src","NovelSeach.jsp");
	});

	$("#chapterCK").on("click",function(){
		$("#myframe").attr("src","chapter.jsp");
	});

	$("#ChapterSearch").on("click",function(){
		$("#myframe").attr("src","ChapterSearch.jsp");
	});
	
	$("#addChapter").on("click",function(){
		$("#myframe").attr("src","addChapter.jsp");
	});
	$("#lb").on("click",function(){
		$("#myframe").attr("src","lb.jsp");
	});
	
	$("#approvalNovel").on("click",function(){
		$("#myframe").attr("src","ApprovalNovel.jsp");
	});
	$("#approvalChapter").on("click",function(){
		$("#myframe").attr("src","ApprovalChapter.jsp");
	});
  </script>
</html>                                                                             
                                              